package ui.render.page
{
	import flash.events.Event;

	//页面变换事件触发
	public class PageChangeEvent extends flash.events.Event
	{
		public function PageChangeEvent( pageindex  :  int, pagesize  :  int )
		{
			super( "PageChange" );
			PageIndex  =  pageindex;
			PageSize  =  pagesize;
		}
		public var PageIndex  :  int  =  0;
		public var PageSize  :  int   =  0;

		public function Filter( list  :  Array )  :  Array
		{
			var newlist  :  Array  =  new Array();
			var start  :  int      =  PageSize * PageIndex;
			var end  :  int        =  start + PageSize;
			for( var i  :  int  =  start; i < end; i++ )
			{
				if( i < list.length )
				{
					newlist.push( list[ i ]);
				}
				else
					break;
			}
			return newlist;
		}
	}

}
